include io.asm

stack segment stack
	dw 128 dup (?)
stack ends

;;======================================================================
data segment
	Head db "Vasilenko Anatoly. Group 111.$"
	Input db "Enter please number: $"
	Output db "Answer: $"
data ends
;;======================================================================

code segment 'code'
	assume ss:stack, ds:data, cs:code
start:
	mov ax,data
	mov ds,ax
	lea dx, Head
	outstr
	newline
	newline
	;;------------------------------------------------------------------
		lea dx, Input;
		outstr;
		
		mov bx, 5;
		mov ax, 0; answer
		mov ch, 0;
		L:	inch cl;
			cmp cx, ' ';
			je short continue;
			sub cl, '0';
			mul bx;
			add ax, cx;
			jmp L;
			
	continue:
		lea dx, Output;
		outstr;
		outint ax;
	
	;;------------------------------------------------------------------

the_end:
	newline;
	newline;
	mov ah,8
	int 21h
    finish
code ends

;;======================================================================
end start 

;;======================================================================
